import { Pipe, PipeTransform } from '@angular/core';
import { SiteService } from '@srvs/site.service';

@Pipe({ name: 'siteOption' })
export class SitePipe implements PipeTransform {
    transform(value: any[], type?: string): any[] {
        switch (type) {
            case 'tree':
                return SiteService.siteToTreeOption(value);
            default:
                return SiteService.siteToOption(value);
        }
    }
}